package com.jp.knowledge.activity;

import android.view.View;

import com.jp.knowledge.R;
import com.jp.knowledge.comm.SlidingActivity;
import com.jp.knowledge.fragment.AttentionDynamicFragment;

/**
 * Created by 528787067@qq.com on 2017/3/20.
 */

public class AttentionStatisticsDetailInfo extends SlidingActivity {

    private String title;
    private String id;
    private String navTypeId;
    private int type;

    private AttentionDynamicFragment fragment;

    @Override
    protected int getResourceId() {
        return R.layout.activity_attention_statistics_detail;
    }

    @Override
    protected void init() {
        this.title = getIntent().getStringExtra("title");
        this.id = getIntent().getStringExtra("id");
        this.navTypeId = getIntent().getStringExtra("navTypeId");
        this.type = getIntent().getIntExtra("type", 9);
        initTitleBar();

        fragment = AttentionDynamicFragment.newInstance(id, type, navTypeId);

        getSupportFragmentManager().beginTransaction()
                .replace(R.id.statisitics_main, fragment)
                .commit();
    }

    private void initTitleBar(){
        leftIcon.setImageResource(R.mipmap.arrow_white_left);
        rightIcon.setVisibility(View.GONE);
        topName.setText(title);
        leftIcon.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }
}
